package service;

import java.util.List;
import dao.User;
import dao.Order;
import dao.OrderDAO;


import org.apache.log4j.Logger;

import util.encryption;
import util.sendMail;

import java.security.MessageDigest;

public class OrderService {
	private OrderDAO OrderDao;
	
	public boolean orderDelete(int orderid,User user) {
		Order order=OrderDao.findById(orderid);
		//不是本人运价
		if(user.getUserid().intValue()!=order.getUser().getUserid().intValue()) {
			return false;	
		}
		//不是 未通过 运价
		if(!order.getOrderstatus().toLowerCase().equals("deny")) {
			return false;
		}
		OrderDao.delete(order);
		return true;
	}

	public OrderDAO getOrderDao() {
		return OrderDao;
	}

	public void setOrderDao(OrderDAO orderDao) {
		OrderDao = orderDao;
	}
	

}
